<template>
  <view class="">
    <cdsq v-if="index == 0" :list="typeList"></cdsq>
    <wdsq v-if="index == 1"></wdsq>

    <dibu
      :jhhbbde="jhhbbde"
      @call="call"
      :index="index"
      v-if="index >= 0"
    ></dibu>
  </view>
</template>
<script>
import cdsq from "./components/cdsq.vue";
import wdsq from "./components/wdsq.vue";
import dibu from "@/components/dibu.vue";
export default {
  data() {
    return {
      typeList: [
        {
          fieldTypeId: 102,
          fieldTypeName: "第一教学楼",
          imgAddress: "www.ssms.com",
        },
        {
          fieldTypeId: 102,
          fieldTypeName: "第一教学楼",
          imgAddress: "www.ssms.com",
        },
      ],
      typeFormData: {},
      myFormData: {
        status: "",
      },
      index: "",
      jhhbbde: [
        {
          name: "场地申请",
          icon: "../../../static/img/dsfa_a.png",
          icons: "../../../static/img/dsfb_a.png",
        },
        {
          name: "我的申请",
          icon: "../../../static/img/dsfa_b.png",
          icons: "../../../static/img/dsfb_b.png",
        },
      ],
    };
  },
  components: {
    dibu,
    cdsq,
    wdsq,
  },
  onLoad(e) {
    this.index = e.ty || 0;
  },
  methods: {
    async fieldTypeTop(data) {
      let that = this;
      let res = await this.$api.fieldTypeTop(data);
      console.log('res',res)
      if(res.code==200){
          that.typeList = res.data;
      }
    },
    goUrl(url) {
      uni.navigateTo({
        url: url,
      });
    },
    call(e) {
      this.index = e;
    },
  },
  mounted(){
	  this.fieldTypeTop()
  }
};
</script>
<style scoped></style>
